package edu.ped.android.nfc;

import java.util.ArrayList;
import java.util.List;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ListView;
import greendroid.app.GDListActivity;
import greendroid.widget.ActionBarItem;
import greendroid.widget.ItemAdapter;
import greendroid.widget.item.Item;
import greendroid.widget.item.SeparatorItem;
import greendroid.widget.item.TextItem;

public class ParametersActivity extends GDListActivity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		ActionBarManager.initActionBar(this,ActionBarManager.PARAMETERS);

		List<Item> items = new ArrayList<Item>();
		items.add(new SeparatorItem(getResources().getString(R.string.configuration)));
		items.add(new TextItem(getResources().getString(R.string.language)));

		final ItemAdapter adapter = new ItemAdapter(this, items);
		setListAdapter(adapter);
	}

	protected void onListItemClick(ListView l, View v, int position, long id) {
		if(position == 1){
			startActivity(new Intent(this,LanguageSelectionActivity.class));
		}
	}

	@Override
	public boolean onHandleActionBarItemClick(ActionBarItem item, int position) {
		if(!ActionBarManager.handleActionBar(this, item, position))
			return super.onHandleActionBarItemClick(item, position);
		return true;
	}
}
